<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        :root {
            --main-bg-color: red;
        }
        .container .content{
            background-color: var(--main-bg-color);
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="content">11111</div>
        <div class="content">22222</div>
    </div>



    <script>
        // 闭包的本质就是：当前环境中存在指向父级作用域的引用。
        function a() {
            let a = 0
            return function() {
                window.a = a
            }
        }

    </script>
</body>

</html>